package com.hengda.smart.speak.d.webservice;

import android.content.Context;

import com.hengda.smart.speak.d.util.SharePreferenceUtil;


/**
 * 
* @Description TODO
* @author wzq
* @date 2015-7-16 ����10:03:42
* @update (date)
* @version V1.0
 */

public class Webservice {


	/**
	 * @Description 登录接口
	 * @author wzq
	 * @date 2015-7-13 下午1:25:32
	 * @update (date)
	 * @version V1.0
	 */
	public class API{
		public static final String TOKEN_REQUEST ="token_request";//获取token
		public static final String LOGIN_CHECK ="login_check";//登录
		public static final String GET_CURRENT_TASK ="get_current_task";//获取当前任务
		public static final String GET_TASK_HISTORY ="get_task_history";//获取历史任务
		public static final String GET_TODAY_TASK ="get_today_task"; //获取今天的任务
		public static final String GET_ALL_POSITION_BT_TASK ="get_task_by_all_position"; //根据位置获取任务信息接口
		public static final String GET_ALL_POSITION ="get_all_map_positions"; //获取所有位置信息
		public static final String ACCEPT_TASK ="accept_task"; //接受任务
		public static final String END_TASK ="end_task"; //结束任务
		public static final String START_TASK ="start_task"; //开始任务
//		public static final String UPDATE_POSTION ="set_task_position"; //更新服务器位置信息
		public static final String SEND_MSG_TO_SERVER = "send_message";//发送消息
	}

	/**
	 *
	 * @Description 返回值code
	 * @author wzq
	 * @date 2015-7-23 下午3:31:41
	 * @update (date)
	 * @version V1.0
	 */
	public class Code{
		public static final int SUCESS=1;//服务请求，请求成功
		public static final int FAIL=0;//服务请求，验证失败
		public static final int NO_API=4;//调用服务不存在
		public static final int DB_ERROR=3;//据库连接错误；错误原因参照返回json 数据中的error 字段
	}


	public class ResCode{
		public static final String ERROR="error";
	}

	/*接口访问地址*/
	public static final String HTTP_HEAD="http://";
	public static final String HTTP_SERVICE="/WebService/";

	/**
	 *
	 * @Description API相关广播
	 * @author wzq
	 * @date 2015-7-23 下午4:40:31
	 * @update (date)
	 * @version V1.0
	 */
	public class Action{

		public static final String REFREASH_MSG         = "HENGDA.1024.MSG.REFREASH";//refreash msg list

		public static final String REFREASH_CURRENT_TASK ="HENGDA.1024.TASK.REFREASH";;//refreash current task list

		public static final String ACTION_LOGIN_SUCCESS="action_login_ok";

	}

	public static String getWebserivceAPi(Context context, SharePreferenceUtil sp){

		return Webservice.HTTP_HEAD+sp.getPHPServerIP()+":"+sp.getPHPPort()+ Webservice.HTTP_SERVICE;
	}


}
